<%--
  User: aleksey
  Date: Oct 1, 2009
  Time: 10:49:01 PM
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<html>
<link rel="icon" href="favicon.ico" type="image/x-icon">
<f:view locale="#{localeManager.locale}">
    <f:loadBundle var="msgs" basename="messages"/>
    <head>
        <title><h:outputText value="#{msgs['title']}"/></title>
        <link href="olga.css" rel="stylesheet" type="text/css">
    </head>
    <body>
        <h:form id="messages">
            <%@include file="logoPanel.jspf"%>
            <%@include file="navigationPanel.jspf"%>

            <h:dataTable id="messagestable" value="#{message.messages}" var="item" styleClass="simpleTable">
                <h:column headerClass="columnHeader">
                    <f:facet name="header"><h:outputText value="User"/></f:facet>
                    <h:outputText value="#{item.user}"/>
                </h:column>
                <h:column headerClass="columnHeader">
                    <f:facet name="header"><h:outputText value="Problem"/></f:facet>
                    <h:outputText value="#{item.problem.letterWithPoint}#{item.problem.name}"/>
                </h:column>
                <h:column headerClass="columnHeader">
                    <f:facet name="header"><h:outputText value="Message"/></f:facet>
                    <h:panelGrid columns="1" styleClass="#{item.style}"><h:outputText escape="false" value="#{item.messageHtml}" styleClass="source"/></h:panelGrid>
                </h:column>
            </h:dataTable>
            <h3>Write new message:</h3>
            <h3>Problem:</h3>
            <h3><h:selectOneListbox id="problem" size="#{message.problemCount}" value="#{message.selectedProblem}"><f:selectItems value="#{message.problems}"/></h:selectOneListbox></h3>
            <h3><h:inputTextarea id="new_message" value="#{message.newMessage}" rows="20" cols="70"/></h3>
            <h3><h:commandButton value="Submit" action="#{message.submit}"/></h3>
        </h:form>
    </body>
</f:view>
</html>
